
float4x4 WorldViewProj : WorldViewProjection;

struct VS_INPUT{
	float3 Position: POSITION;
	float4 UV: TEXCOORD0;
};
struct VS_OUTPUT{
    float4 pos:POSITION;
    float4 UV: TEXCOORD0;
};

texture BaseTexture: TEXTURE0;

sampler2D BaseSampler = sampler_state
{
    Texture = (BaseTexture);
    MIPFILTER = LINEAR;
    MAGFILTER = LINEAR;
    MINFILTER = LINEAR;
	ADDRESSU = WRAP;
	ADDRESSV=WRAP;
};

VS_OUTPUT mainVS(VS_INPUT input){
    VS_OUTPUT output;
    output.pos=mul(float4(input.Position, 1.0), WorldViewProj);
    output.UV=input.UV;

    return output;
}

float4 mainPS(VS_OUTPUT IN) : COLOR {
	// Lighting
	float4 TexColor = tex2D(BaseSampler,IN.UV);
	return TexColor;
}

technique Simple {
	pass p0 {
		ZEnable=true;
		ZWriteEnable=true;
		AlphaBlendEnable = true;
		SRCBLEND = SRCALPHA;
		DESTBLEND = INVSRCALPHA;

		VertexShader = compile vs_3_0 mainVS();
		PixelShader = compile ps_3_0 mainPS();
	}
}
